import re


def replace_lenth_unit(s):
    '''
    单位换成汉字
    '''
    pattern = r"(?<![a-zA-Z])cm$"
    if re.search(pattern, s):
        return re.sub("cm$", "厘米", s)

    pattern = r"(?<![a-zA-Z])m$"
    if re.search(pattern, s):
        return re.sub("m$", "米", s)

    pattern = r"(?<![a-zA-Z])mm$"
    if re.search(pattern, s):
        return re.sub("mm$", "毫米", s)

    pattern = r"(?<![a-zA-Z])yd$"
    if re.search(pattern, s):
        return re.sub("yd$", "码", s)

    pattern = r"(?<![a-zA-Z])ft$"
    if re.search(pattern, s):
        return re.sub("ft$", "英尺", s)

    pattern = r"(?<![a-zA-Z])in$"
    if re.search(pattern, s):
        return re.sub("in$", "英寸", s)
    return s


# test cases
print(replace_lenth_unit("100 cm"))  # Expected output: "100厘米"
print(replace_lenth_unit("100m"))   # Expected output: "100m"
print(replace_lenth_unit("abc100cm"))  # Expected output: "abc100厘米"
print(replace_lenth_unit("abc100in"))  # Expected output: "abc100acm"
